 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKSsl/SslModel.h>

@implementation RecordValidate
-(id) initWithValidateType:(NSString*) validateType
      validateKey:(NSString*)validateKey
      recordType:(NSString*)recordType
      validateValue:(NSString*)validateValue { 
     self.validateType = validateType;               
     self.validateKey = validateKey;               
     self.recordType = recordType;               
     self.validateValue = validateValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self validateType])
    {
        [result setValue:[self validateType] forKey:@"validateType"];
    }
    if([self validateKey])
    {
        [result setValue:[self validateKey] forKey:@"validateKey"];
    }
    if([self recordType])
    {
        [result setValue:[self recordType] forKey:@"recordType"];
    }
    if([self validateValue])
    {
        [result setValue:[self validateValue] forKey:@"validateValue"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.validateType = [dictionary objectForKey:@"validateType"];
    self.validateKey = [dictionary objectForKey:@"validateKey"];
    self.recordType = [dictionary objectForKey:@"recordType"];
    self.validateValue = [dictionary objectForKey:@"validateValue"];
    return self;
}
 @end
@implementation DiscountDetailList
-(id) initWithServiceCode:(NSString*) serviceCode
      billPeriod:(NSNumber*)billPeriod
      message:(NSString*)message
      discount:(NSNumber*)discount { 
     self.serviceCode = serviceCode;               
     self.billPeriod = billPeriod;               
     self.message = message;               
     self.discount = discount;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self billPeriod])
    {
        [result setValue:[self billPeriod] forKey:@"billPeriod"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    if([self discount])
    {
        [result setValue:[self discount] forKey:@"discount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.billPeriod = [dictionary objectForKey:@"billPeriod"];
    self.message = [dictionary objectForKey:@"message"];
    self.discount = [dictionary objectForKey:@"discount"];
    return self;
}
 @end
@implementation CertBindInfo
-(id) initWithBindFrom:(NSString*) bindFrom
      bindId:(NSString*)bindId
      bindRegion:(NSString*)bindRegion
      bindZone:(NSString*)bindZone { 
     self.bindFrom = bindFrom;               
     self.bindId = bindId;               
     self.bindRegion = bindRegion;               
     self.bindZone = bindZone;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self bindFrom])
    {
        [result setValue:[self bindFrom] forKey:@"bindFrom"];
    }
    if([self bindId])
    {
        [result setValue:[self bindId] forKey:@"bindId"];
    }
    if([self bindRegion])
    {
        [result setValue:[self bindRegion] forKey:@"bindRegion"];
    }
    if([self bindZone])
    {
        [result setValue:[self bindZone] forKey:@"bindZone"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.bindFrom = [dictionary objectForKey:@"bindFrom"];
    self.bindId = [dictionary objectForKey:@"bindId"];
    self.bindRegion = [dictionary objectForKey:@"bindRegion"];
    self.bindZone = [dictionary objectForKey:@"bindZone"];
    return self;
}
 @end
@implementation RecordListDetail
-(id) initWithRecordId:(NSString*) recordId
      orderId:(NSString*)orderId
      commonName:(NSString*)commonName
      supplier:(NSString*)supplier
      brand:(NSString*)brand
      certType:(NSString*)certType
      certValidity:(NSNumber*)certValidity
      state:(NSNumber*)state
      partnerOrderId:(NSString*)partnerOrderId
      domainCount:(NSNumber*)domainCount
      wildcardDomainCount:(NSNumber*)wildcardDomainCount
      dnsNames:(NSArray<NSString*>*)dnsNames
      certId:(NSString*)certId { 
     self.recordId = recordId;               
     self.orderId = orderId;               
     self.commonName = commonName;               
     self.supplier = supplier;               
     self.brand = brand;               
     self.certType = certType;               
     self.certValidity = certValidity;               
     self.state = state;               
     self.partnerOrderId = partnerOrderId;               
     self.domainCount = domainCount;               
     self.wildcardDomainCount = wildcardDomainCount;               
     self.dnsNames = dnsNames;               
     self.certId = certId;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self recordId])
    {
        [result setValue:[self recordId] forKey:@"recordId"];
    }
    if([self orderId])
    {
        [result setValue:[self orderId] forKey:@"orderId"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    if([self supplier])
    {
        [result setValue:[self supplier] forKey:@"supplier"];
    }
    if([self brand])
    {
        [result setValue:[self brand] forKey:@"brand"];
    }
    if([self certType])
    {
        [result setValue:[self certType] forKey:@"certType"];
    }
    if([self certValidity])
    {
        [result setValue:[self certValidity] forKey:@"certValidity"];
    }
    if([self state])
    {
        [result setValue:[self state] forKey:@"state"];
    }
    if([self partnerOrderId])
    {
        [result setValue:[self partnerOrderId] forKey:@"partnerOrderId"];
    }
    if([self domainCount])
    {
        [result setValue:[self domainCount] forKey:@"domainCount"];
    }
    if([self wildcardDomainCount])
    {
        [result setValue:[self wildcardDomainCount] forKey:@"wildcardDomainCount"];
    }
    if([self dnsNames])
    {
        [result setValue:[self dnsNames] forKey:@"dnsNames"];
    }
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.recordId = [dictionary objectForKey:@"recordId"];
    self.orderId = [dictionary objectForKey:@"orderId"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    self.supplier = [dictionary objectForKey:@"supplier"];
    self.brand = [dictionary objectForKey:@"brand"];
    self.certType = [dictionary objectForKey:@"certType"];
    self.certValidity = [dictionary objectForKey:@"certValidity"];
    self.state = [dictionary objectForKey:@"state"];
    self.partnerOrderId = [dictionary objectForKey:@"partnerOrderId"];
    self.domainCount = [dictionary objectForKey:@"domainCount"];
    self.wildcardDomainCount = [dictionary objectForKey:@"wildcardDomainCount"];
    self.dnsNames = [dictionary objectForKey:@"dnsNames"];
    self.certId = [dictionary objectForKey:@"certId"];
    return self;
}
 @end
@implementation ValidateQueryResult
-(id) initWithValidateKey:(NSString*) validateKey
      validateValue:(NSString*)validateValue { 
     self.validateKey = validateKey;               
     self.validateValue = validateValue;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self validateKey])
    {
        [result setValue:[self validateKey] forKey:@"validateKey"];
    }
    if([self validateValue])
    {
        [result setValue:[self validateValue] forKey:@"validateValue"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.validateKey = [dictionary objectForKey:@"validateKey"];
    self.validateValue = [dictionary objectForKey:@"validateValue"];
    return self;
}
 @end
@implementation DownloadCertDesc
-(id) initWithCertId:(NSString*) certId
      certName:(NSString*)certName
      keyFile:(NSString*)keyFile
      certFile:(NSString*)certFile
      digest:(NSString*)digest
      caCertFile:(NSString*)caCertFile
      serverType:(NSString*)serverType
      certEncryptePassword:(NSString*)certEncryptePassword
      commonName:(NSString*)commonName { 
     self.certId = certId;               
     self.certName = certName;               
     self.keyFile = keyFile;               
     self.certFile = certFile;               
     self.digest = digest;               
     self.caCertFile = caCertFile;               
     self.serverType = serverType;               
     self.certEncryptePassword = certEncryptePassword;               
     self.commonName = commonName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self keyFile])
    {
        [result setValue:[self keyFile] forKey:@"keyFile"];
    }
    if([self certFile])
    {
        [result setValue:[self certFile] forKey:@"certFile"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    if([self caCertFile])
    {
        [result setValue:[self caCertFile] forKey:@"caCertFile"];
    }
    if([self serverType])
    {
        [result setValue:[self serverType] forKey:@"serverType"];
    }
    if([self certEncryptePassword])
    {
        [result setValue:[self certEncryptePassword] forKey:@"certEncryptePassword"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.certName = [dictionary objectForKey:@"certName"];
    self.keyFile = [dictionary objectForKey:@"keyFile"];
    self.certFile = [dictionary objectForKey:@"certFile"];
    self.digest = [dictionary objectForKey:@"digest"];
    self.caCertFile = [dictionary objectForKey:@"caCertFile"];
    self.serverType = [dictionary objectForKey:@"serverType"];
    self.certEncryptePassword = [dictionary objectForKey:@"certEncryptePassword"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    return self;
}
 @end
@implementation CertListDetail
-(id) initWithCertId:(NSString*) certId
      certName:(NSString*)certName
      commonName:(NSString*)commonName
      certType:(NSString*)certType
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime
      deletable:(NSNumber*)deletable
      digest:(NSString*)digest
      aliasName:(NSString*)aliasName
      dnsNames:(NSArray<NSString*>*)dnsNames
      downloadable:(NSNumber*)downloadable
      updateable:(NSNumber*)updateable
      certStatus:(NSNumber*)certStatus { 
     self.certId = certId;               
     self.certName = certName;               
     self.commonName = commonName;               
     self.certType = certType;               
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.deletable = deletable;               
     self.digest = digest;               
     self.aliasName = aliasName;               
     self.dnsNames = dnsNames;               
     self.downloadable = downloadable;               
     self.updateable = updateable;               
     self.certStatus = certStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    if([self certType])
    {
        [result setValue:[self certType] forKey:@"certType"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self deletable])
    {
        [result setValue:[self deletable] forKey:@"deletable"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    if([self aliasName])
    {
        [result setValue:[self aliasName] forKey:@"aliasName"];
    }
    if([self dnsNames])
    {
        [result setValue:[self dnsNames] forKey:@"dnsNames"];
    }
    if([self downloadable])
    {
        [result setValue:[self downloadable] forKey:@"downloadable"];
    }
    if([self updateable])
    {
        [result setValue:[self updateable] forKey:@"updateable"];
    }
    if([self certStatus])
    {
        [result setValue:[self certStatus] forKey:@"certStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.certName = [dictionary objectForKey:@"certName"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    self.certType = [dictionary objectForKey:@"certType"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.deletable = [dictionary objectForKey:@"deletable"];
    self.digest = [dictionary objectForKey:@"digest"];
    self.aliasName = [dictionary objectForKey:@"aliasName"];
    self.dnsNames = [dictionary objectForKey:@"dnsNames"];
    self.downloadable = [dictionary objectForKey:@"downloadable"];
    self.updateable = [dictionary objectForKey:@"updateable"];
    self.certStatus = [dictionary objectForKey:@"certStatus"];
    return self;
}
 @end
@implementation CertQuotaLimitDetail
-(id) initWithId:(NSNumber*) idValue
      account:(NSString*)account
      freeUploadCertCount:(NSNumber*)freeUploadCertCount
      freeDVSingleCount:(NSNumber*)freeDVSingleCount { 
     self.idValue = idValue;               
     self.account = account;               
     self.freeUploadCertCount = freeUploadCertCount;               
     self.freeDVSingleCount = freeDVSingleCount;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self idValue])
    {
        [result setValue:[self idValue] forKey:@"id"];
    }
    if([self account])
    {
        [result setValue:[self account] forKey:@"account"];
    }
    if([self freeUploadCertCount])
    {
        [result setValue:[self freeUploadCertCount] forKey:@"freeUploadCertCount"];
    }
    if([self freeDVSingleCount])
    {
        [result setValue:[self freeDVSingleCount] forKey:@"freeDVSingleCount"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.idValue = [dictionary objectForKey:@"id"];
    self.account = [dictionary objectForKey:@"account"];
    self.freeUploadCertCount = [dictionary objectForKey:@"freeUploadCertCount"];
    self.freeDVSingleCount = [dictionary objectForKey:@"freeDVSingleCount"];
    return self;
}
 @end
@implementation RecordDescDetail
-(id) initWithRecordId:(NSString*) recordId
      orderId:(NSString*)orderId
      certName:(NSString*)certName
      brand:(NSString*)brand
      certType:(NSString*)certType
      domainCount:(NSNumber*)domainCount
      wildcardDomainCount:(NSNumber*)wildcardDomainCount
      certValidity:(NSNumber*)certValidity
      commonName:(NSString*)commonName
      state:(NSNumber*)state
      canceledReason:(NSString*)canceledReason
      recordValidate:(RecordValidate*)recordValidate
      corpName:(NSString*)corpName
      corpAddr:(NSString*)corpAddr
      dnsNames:(NSArray<NSString*>*)dnsNames
      email:(NSString*)email
      errorMessage:(NSString*)errorMessage { 
     self.recordId = recordId;               
     self.orderId = orderId;               
     self.certName = certName;               
     self.brand = brand;               
     self.certType = certType;               
     self.domainCount = domainCount;               
     self.wildcardDomainCount = wildcardDomainCount;               
     self.certValidity = certValidity;               
     self.commonName = commonName;               
     self.state = state;               
     self.canceledReason = canceledReason;               
     self.recordValidate = recordValidate;               
     self.corpName = corpName;               
     self.corpAddr = corpAddr;               
     self.dnsNames = dnsNames;               
     self.email = email;               
     self.errorMessage = errorMessage;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self recordId])
    {
        [result setValue:[self recordId] forKey:@"recordId"];
    }
    if([self orderId])
    {
        [result setValue:[self orderId] forKey:@"orderId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self brand])
    {
        [result setValue:[self brand] forKey:@"brand"];
    }
    if([self certType])
    {
        [result setValue:[self certType] forKey:@"certType"];
    }
    if([self domainCount])
    {
        [result setValue:[self domainCount] forKey:@"domainCount"];
    }
    if([self wildcardDomainCount])
    {
        [result setValue:[self wildcardDomainCount] forKey:@"wildcardDomainCount"];
    }
    if([self certValidity])
    {
        [result setValue:[self certValidity] forKey:@"certValidity"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    if([self state])
    {
        [result setValue:[self state] forKey:@"state"];
    }
    if([self canceledReason])
    {
        [result setValue:[self canceledReason] forKey:@"canceledReason"];
    }
    if([self recordValidate])
    {
        [result setValue:[[self recordValidate] dictionary]forKey:@"recordValidate"];
    }
    if([self corpName])
    {
        [result setValue:[self corpName] forKey:@"corpName"];
    }
    if([self corpAddr])
    {
        [result setValue:[self corpAddr] forKey:@"corpAddr"];
    }
    if([self dnsNames])
    {
        [result setValue:[self dnsNames] forKey:@"dnsNames"];
    }
    if([self email])
    {
        [result setValue:[self email] forKey:@"email"];
    }
    if([self errorMessage])
    {
        [result setValue:[self errorMessage] forKey:@"errorMessage"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.recordId = [dictionary objectForKey:@"recordId"];
    self.orderId = [dictionary objectForKey:@"orderId"];
    self.certName = [dictionary objectForKey:@"certName"];
    self.brand = [dictionary objectForKey:@"brand"];
    self.certType = [dictionary objectForKey:@"certType"];
    self.domainCount = [dictionary objectForKey:@"domainCount"];
    self.wildcardDomainCount = [dictionary objectForKey:@"wildcardDomainCount"];
    self.certValidity = [dictionary objectForKey:@"certValidity"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    self.state = [dictionary objectForKey:@"state"];
    self.canceledReason = [dictionary objectForKey:@"canceledReason"];
    self.recordValidate = [[RecordValidate alloc]initWithDic:[dictionary objectForKey:@"recordValidate"]];
    self.corpName = [dictionary objectForKey:@"corpName"];
    self.corpAddr = [dictionary objectForKey:@"corpAddr"];
    self.dnsNames = [dictionary objectForKey:@"dnsNames"];
    self.email = [dictionary objectForKey:@"email"];
    self.errorMessage = [dictionary objectForKey:@"errorMessage"];
    return self;
}
 @end
@implementation CertDescDetail
-(id) initWithCertId:(NSString*) certId
      certName:(NSString*)certName
      commonName:(NSString*)commonName
      certType:(NSString*)certType
      issuer:(NSString*)issuer
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime
      dnsNames:(NSArray<NSString*>*)dnsNames
      digest:(NSString*)digest
      totalCount:(NSNumber*)totalCount
      usedBy:(NSArray<CertBindInfo*>*)usedBy { 
     self.certId = certId;               
     self.certName = certName;               
     self.commonName = commonName;               
     self.certType = certType;               
     self.issuer = issuer;               
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.dnsNames = dnsNames;               
     self.digest = digest;               
     self.totalCount = totalCount;               
     self.usedBy = usedBy;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self certId])
    {
        [result setValue:[self certId] forKey:@"certId"];
    }
    if([self certName])
    {
        [result setValue:[self certName] forKey:@"certName"];
    }
    if([self commonName])
    {
        [result setValue:[self commonName] forKey:@"commonName"];
    }
    if([self certType])
    {
        [result setValue:[self certType] forKey:@"certType"];
    }
    if([self issuer])
    {
        [result setValue:[self issuer] forKey:@"issuer"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self dnsNames])
    {
        [result setValue:[self dnsNames] forKey:@"dnsNames"];
    }
    if([self digest])
    {
        [result setValue:[self digest] forKey:@"digest"];
    }
    if([self totalCount])
    {
        [result setValue:[self totalCount] forKey:@"totalCount"];
    }
    if([self usedBy])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self usedBy] count]; i++) {
            CertBindInfo* item = [[self usedBy] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"usedBy"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.certId = [dictionary objectForKey:@"certId"];
    self.certName = [dictionary objectForKey:@"certName"];
    self.commonName = [dictionary objectForKey:@"commonName"];
    self.certType = [dictionary objectForKey:@"certType"];
    self.issuer = [dictionary objectForKey:@"issuer"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.dnsNames = [dictionary objectForKey:@"dnsNames"];
    self.digest = [dictionary objectForKey:@"digest"];
    self.totalCount = [dictionary objectForKey:@"totalCount"];
    NSArray* usedByArray = [dictionary objectForKey:@"usedBy"];
    if(usedByArray&&![usedByArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [usedByArray count];i++)
        {
            CertBindInfo* item = [[CertBindInfo alloc]initWithDic:[usedByArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.usedBy = propertyArray;
    }
    return self;
}
 @end
 
 


